[#import "/framework/JGP.htm"  as JGP]
<!--
项目   parent
作者   LOUFEI [Gavin]
时间   2018/4/12
-->
[@JGP.head "Title"/]
[@JGP.body]
   <jgp-div slot="1-1" _row="['28','70','*']" _runit="px" _aux="true">
       <div slot="1-1">
           <jgp-btn _fn="addUser">新建用户</jgp-btn>
       </div>
       <jgp-query slot="2-1" _target="userGrid" _action="/security/admin/adminApiController/queryUsers">
           <jgp-form-group _title="搜索条件">
               <jgp-text _label="用户名" _name="username"></jgp-text>
           </jgp-form-group>
       </jgp-query>
       <jgp-grid slot="3-1" _id="userGrid" _check="false" _tools_name="true"
                 _record_tools="[{'icon':'edit','tip':'编辑','fn':'edit'},
                 {'icon':'drivers-license-o','tip':'配置角色','fn':'editUserRoles'}]">
       </jgp-grid>
   </jgp-div>
[/@JGP.body]

[@JGP.foot]

    <script>
        function addUser(){
            var dialog = {
                'title': '添加用户',
                'width': '400px',
                'height': '300px',
                'url': '/security/addUser',
                'callback': function (result) {
                    if(result){
                        console.log(result)
                    }
                }
            };
            JGP.$dialog(dialog);
        }

        function editUserRoles(result){
            var dialog = {
                'title': '添加用户',
                'width': '200px',
                'height': '300px',
                'url': '/security/editUserRoles/'+result.back.record.id,
                'callback': function (result) {
                    if(result){
                        console.log(result)
                    }
                }
            };
            JGP.$dialog(dialog);
        }
    </script>
[/@JGP.foot]